package acm.usa2006.gnewyork;

import java.util.Scanner;

/*
 * p2538
 * Greater New York 2006
 */

public class p2538 {

	static int N, n, res;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		N = scanner.nextInt();
		for (int i=1;i<=N;++i) {
			n = scanner.nextInt();
			res = 0;
			for (int k=1;k<=n;++k) {
				res += k * T(k+1);
			}
			System.out.println(i + " " + n + " " + res);
		}

	}

	private static int T(int k) {
		return k * (k + 1) / 2;
	}

}
